#!/bin/bash

function site_all() {
	for sitename in `ls /var/www/$PLATOLD/sites`
	do
		if [ $sitename != "all" ] && [ $sitename != "default" ]
		then
			/vagrant/sitescripts/site_upgrade.sh $sitename $PLATOLD $PLATNEW
		fi
	done

	/etc/init.d/apache2 restart
}


if [ $# -eq 2 ]
then
	PLATOLD=$1
	PLATNEW=$2
	
	site_all
else
	echo "Usage: site_upgrade_all.sh <old_platform_name> <new_platform_name>"
	exit -1
fi